# -*- coding: utf-8 -*-
"""
Created on Fri Sep 13 12:43:36 2019

@author: Administrator
"""

# 1039 到底买不买
# 小红需要符合自己要求的珠子
# 思路：
# 对珠子的颜色进行编码，
# 获取给定的珠子和需要珠子的编码，
# 根据自己需要的珠子，判断给出的珠子是否满足即可

# 使用list存储数据
# 不改变need balls，改变total balls
# 对于满足需要的珠子，从total list中删除
# 对于不满足需要的珠子，记录到not_satisfied list中

# 语法细节：
# for xx: else:
# 如果所有元素不满足要求后，则xx
# 对于C语言，没有这个语法，则在for语句中计数，在for做判断，如果达到最后一个元素，xx

def test():
    
    raw_balls = str(input())
    balls = [ele for ele in raw_balls]
    
    raw_needs = str(input())
    needs = [ele for ele in raw_needs]
    
    not_satistied = []
    
    for need in needs:
        for ball in balls:
            if need == ball:
                first_ball = balls.index(ball)
                balls.pop(first_ball)
                break
        else:
            not_satistied.append(need)
            
    if len(not_satistied) != 0:
        print('No %d' % len(not_satistied))
    else:
        print('Yes %d' % len(balls))
        
                
test()      